package com.climber.android.commonsdk.api.interceptor

import okhttp3.*

/**
 * Created by Mikes at 2020-04-02 11:03
 */
class MockAPIInterceptor : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {

        return Response.Builder()
                .request(chain.request())
                .protocol(Protocol.HTTP_1_0)
                .message("This is mock message")
                .body(ResponseBody.create(MediaType.parse("application/json"), "{\"code\":20000, \"errorMsg\":\"This is mock message\"}"))
                .addHeader("Mock-API", "This is mock message")
                .code(200)
                .build()
    }
}